package com.kovell.cairngormlite
{
	import com.adobe.cairngorm.business.Responder;
	import com.adobe.cairngorm.commands.Command;
	import com.adobe.cairngorm.control.CairngormEvent;
	
	import mx.controls.Alert;

	public class CairngormliteCommand implements Command, Responder
	{
		
		protected var isDelegate:Boolean = true;
		
		public function CairngormliteCommand()
		{
		}
		
		public function execute(event:CairngormEvent):void{
			var eve:CairngormliteEvent = event as CairngormliteEvent;	
			onProcess(eve);
			
			if(isDelegate){
				var delegate:CairngormliteDelegate = new CairngormliteDelegate(this, eve.serviceId);
				delegate.invoke(eve.method, eve.args);
			}
			else{
				trace("Delegate is false. Not trigger to server-side yet.");
			}
		}
		
		public function onProcess(event:CairngormliteEvent):void{
			
		}
		
		public function onResult(event:* = null):void{
		
		}
		
		public function onFault(event:* = null):void{
		
		}
	}
}